package com.hp.easyBuy.utils;

import java.util.List;

/*
* 封装page数据
*
* */
public class MyPage <T>{

        private Integer currentPage; //当前页码
        private Integer pageSize;   //每页条数
        private Long totalCount;    //总记录条数
        private Long totalPage;     //总页数
        private List<T> list;    //列表集合

        public Integer getCurrentPage() {
            return currentPage;
        }

        public void setCurrentPage(Integer currentPage) {
            this.currentPage = currentPage;
        }

        public Integer getPageSize() {
            return pageSize;
        }

        public void setPageSize(Integer pageSize) {
            this.pageSize = pageSize;
        }

        public Long getTotalCount() {
            return totalCount;
        }

        public void setTotalCount(Long totalCount) {
            this.totalCount = totalCount;
        }

        public Long getTotalPage() {
            return totalCount % pageSize == 0 ? totalCount/pageSize : totalCount/pageSize + 1;
        }

        public void setTotalPage(Long totalPage) {
            this.totalPage = totalPage;
        }

        public List<T> getList() {
            return list;
        }

        public void setList(List<T> list) {
            this.list = list;
        }
}
